package cn.gson.springboot.model.dao.saledao;

import cn.gson.springboot.model.pjos.Returnorder;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface ReturnorderDao extends CrudRepository<Returnorder,Integer> {
//    查询客户的退货单
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "select * from returnorder where retu_customerid = ?1")
    public List<Returnorder> returnOrder(Integer congId);

//    合并
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "update returnorder set retu_customerid = ?1 where retu_customerid = ?2")
    public void updateReturnOrder(Integer daoId,Integer congId);

}
